package ch.ethz.fcl.metrobuzz.data.transit;

import ch.ethz.fcl.metrobuzz.data.scene.basemap.Node;

/**
 * Event of moving objects, contains location and time information
 * 
 * @author Zeng Wei
 * @email zeng@arch.ethz.ch
 * 
 */
public class TransitEvent {
	private Node node;
	private float time;
	private EventType type;

	public TransitEvent(Node node, float time) {
		this.node = node;
		this.time = time;
	}

	public Node getNode() {
		return node;
	}

	public float getTime() {
		return time;
	}

	public void setType(String type) {
		if (type.equals("entered link"))
			this.type = EventType.ENTER_LINK;
		else if (type.equals("left link"))
			this.type = EventType.LEFT_LINK;
		else if (type.equals("departure"))
			this.type = EventType.DEPARTURE;
		else if (type.equals("TransitDriverStarts"))
			this.type = EventType.STARTS;
		else if (type.equals("VehicleArrivesAtFacility"))
			this.type = EventType.ARRIVE_FACILITY;
	}

	public EventType getType() {
		return type;
	}

	public enum EventType {
		DEPARTURE, STARTS, ENTER_LINK, LEFT_LINK, ARRIVE_FACILITY
	}
}
